
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>如何新增一个模块 · PSI使用手册</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="李静波">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="styles/website.css">
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    
    <link rel="prev" href="tech.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://gitee.com/crm8000/PSI" target="_blank" class="custom-link">PSI官网</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    关于
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="user.html">
            
                <a href="user.html">
            
                    
                    普通用户使用手册
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="00.html">
            
                <a href="00.html">
            
                    
                    通用操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="10.html">
            
                <a href="10.html">
            
                    
                    登录
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="20.html">
            
                <a href="20.html">
            
                    
                    采购业务
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.3.1" data-path="20-01.html">
            
                <a href="20-01.html">
            
                    
                    采购订单
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.2" data-path="20-02.html">
            
                <a href="20-02.html">
            
                    
                    采购入库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.3" data-path="20-03.html">
            
                <a href="20-03.html">
            
                    
                    采购退货出库
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="30.html">
            
                <a href="30.html">
            
                    
                    销售业务
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.4.1" data-path="30-04.html">
            
                <a href="30-04.html">
            
                    
                    销售合同
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.2" data-path="30-01.html">
            
                <a href="30-01.html">
            
                    
                    销售订单
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.3" data-path="30-02.html">
            
                <a href="30-02.html">
            
                    
                    销售出库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.4" data-path="30-03.html">
            
                <a href="30-03.html">
            
                    
                    销售退货入库
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="40.html">
            
                <a href="40.html">
            
                    
                    库存管理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.5.1" data-path="40-01.html">
            
                <a href="40-01.html">
            
                    
                    库间调拨
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5.2" data-path="40-02.html">
            
                <a href="40-02.html">
            
                    
                    库存盘点
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="60.html">
            
                <a href="60.html">
            
                    
                    加工业务
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.6.1" data-path="60-01.html">
            
                <a href="60-01.html">
            
                    
                    存货拆分
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="50.html">
            
                <a href="50.html">
            
                    
                    资金管理
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="admin.html">
            
                <a href="admin.html">
            
                    
                    系统管理员使用手册
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="01.html">
            
                <a href="01.html">
            
                    
                    安装
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1.1" data-path="01-01.html">
            
                <a href="01-01.html">
            
                    
                    在魔泊云部署
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="02.html">
            
                <a href="02.html">
            
                    
                    初始化
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.2.1" data-path="02-01.html">
            
                <a href="02-01.html">
            
                    
                    用户管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.2" data-path="02-02.html">
            
                <a href="02-02.html">
            
                    
                    权限管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.3" data-path="02-04.html">
            
                <a href="02-04.html">
            
                    
                    商品
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.2.3.1" data-path="02-04-01.html">
            
                <a href="02-04-01.html">
            
                    
                    商品计量单位
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.3.2" data-path="02-04-02.html">
            
                <a href="02-04-02.html">
            
                    
                    商品品牌
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.3.3" data-path="02-04-03.html">
            
                <a href="02-04-03.html">
            
                    
                    价格体系
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.3.4" data-path="02-04-04.html">
            
                <a href="02-04-04.html">
            
                    
                    成本分摊
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.2.4" data-path="02-07.html">
            
                <a href="02-07.html">
            
                    
                    供应商档案
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.5" data-path="02-08.html">
            
                <a href="02-08.html">
            
                    
                    客户资料
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.6" data-path="02-05.html">
            
                <a href="02-05.html">
            
                    
                    仓库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.7" data-path="02-06.html">
            
                <a href="02-06.html">
            
                    
                    库存建账
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.8" data-path="02-03.html">
            
                <a href="02-03.html">
            
                    
                    业务设置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.9" data-path="02-09.html">
            
                <a href="02-09.html">
            
                    
                    工厂
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="03.html">
            
                <a href="03.html">
            
                    
                    业务日志
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="04.html">
            
                <a href="04.html">
            
                    
                    如何升级PSI
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="05.html">
            
                <a href="05.html">
            
                    
                    数据域应用详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="06.html">
            
                <a href="06.html">
            
                    
                    环境变量
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="07.html">
            
                <a href="07.html">
            
                    
                    Lodop打印
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="tech.html">
            
                <a href="tech.html">
            
                    
                    二次开发技术手册
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.4.1" data-path="100.html">
            
                <a href="100.html">
            
                    
                    如何新增一个模块
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >如何新增一个模块</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x5982;&#x4F55;&#x65B0;&#x589E;&#x4E00;&#x4E2A;&#x6A21;&#x5757;">&#x5982;&#x4F55;&#x65B0;&#x589E;&#x4E00;&#x4E2A;&#x6A21;&#x5757;</h1>
<hr>
<p>1&#x3001;fid</p>
<p><code>fid</code>&#x662F;&#x529F;&#x80FD;id&#x7684;&#x7F29;&#x5199;&#x3002;&#x4E00;&#x4E2A;<code>fid</code>&#x53EA;&#x8981;&#x505A;&#x5230;&#x5168;&#x5C40;&#x552F;&#x4E00;&#x5373;&#x53EF;&#xFF0C;&#x4F46;&#x662F;&#x6700;&#x597D;&#x53C2;&#x8003;PSI&#x73B0;&#x5728;&#x7684;&#x9ED8;&#x8BA4;&#x547D;&#x540D;&#x60EF;&#x4F8B;&#x3002;</p>
<p><code>fid</code>&#x7684;&#x5B9A;&#x4E49;&#x5728;&#xFF1A;<a href="https://gitee.com/crm8000/PSI/blob/master/web/Application/Home/Common/FIdConst.class.php" target="_blank">/web/Application/Home/Common/FIdConst.class.php</a></p>
<p>2&#x3001;&#x4E3B;&#x83DC;&#x5355;</p>
<p>&#x7528;&#x6237;&#x8FDB;&#x5165;&#x4E00;&#x4E2A;&#x4E1A;&#x52A1;&#x6A21;&#x5757;&#x7684;&#x64CD;&#x4F5C;&#x5165;&#x53E3;&#x662F;&#x4E3B;&#x83DC;&#x5355;&#x3002;</p>
<p>PSI&#x7684;&#x4E3B;&#x83DC;&#x5355;&#x5B9A;&#x4E49;&#x5728;&#x6570;&#x636E;&#x5E93;&#x7684;&#x8868; <code>t_menu_item</code> &#x4E2D;&#xFF0C;&#x8868;&#x7ED3;&#x6784;&#x7684;&#x5177;&#x4F53;&#x542B;&#x4E49;&#x8BF7;&#x53C2;&#x8003; <code>/doc/02 &#x8868;&#x7ED3;&#x6784;/&#x8868;&#x7ED3;&#x6784;&#x8BF4;&#x660E;.xlsx</code>&#x3002;</p>
<p><code>t_menu_item</code>&#x4E2D;&#x7684;&#x4E00;&#x6761;&#x8BB0;&#x5F55;&#x5C31;&#x5BF9;&#x5E94;&#x4E00;&#x4E2A;&#x83DC;&#x5355;&#x9879;&#xFF0C;&#x6240;&#x4EE5;&#x65B0;&#x52A0;&#x4E00;&#x4E2A;&#x6A21;&#x5757;&#xFF0C;&#x5C31;&#x9700;&#x8981;&#x5411;<code>t_menu_item</code>&#x4E2D;&#x6DFB;&#x52A0;&#x4E00;&#x6761;&#x65B0;&#x8BB0;&#x5F55;&#x3002;</p>
<p>&#x83DC;&#x5355;&#x7684;&#x56FE;&#x6807;&#x662F;&#x7528;css&#x5B9E;&#x73B0;&#x7684;&#xFF0C;&#x8BE5;css&#x6587;&#x4EF6;&#x5728;<a href="https://gitee.com/crm8000/PSI/blob/master/web/Public/Content/icons.css" target="_blank">PSI/web/Public/Content/icons.css</a></p>
<p>&#x4F8B;&#x5982;&#xFF1A;&#x5BA2;&#x6237;&#x8D44;&#x6599;&#x7684;fid&#x662F;1007&#xFF0C;&#x90A3;&#x4E48;&#x5B83;&#x7684;&#x56FE;&#x6807;&#x5728;css&#x4E2D;&#x5C31;&#x662F;&#x8FD9;&#x4E48;&#x5199;&#x7684;</p>
<pre><code>.PSI-fid1007 {
    background-image:url(../Images/fid/fid1007.png) !important;
}
</code></pre><p>3&#x3001;&#x6743;&#x9650;</p>
<p>&#x7ED9;&#x8868; <code>t_permission</code> &#x4E2D;&#x65B0;&#x589E;&#x4E00;&#x6761;&#x8BB0;&#x5F55;&#xFF0C;&#x5BF9;&#x5E94;&#x4E8E;&#x901A;&#x8FC7;&#x83DC;&#x5355;&#x8FDB;&#x5165;&#x4E1A;&#x52A1;&#x6A21;&#x5757;&#x7684;&#x6743;&#x9650;&#x3002;</p>
<p>&#x5982;&#x679C;&#x9875;&#x9762;&#x91CC;&#x9762;&#x7684;&#x6309;&#x94AE;&#x4E5F;&#x9700;&#x8981;&#x6743;&#x9650;&#x63A7;&#x5236;&#xFF0C;&#x6709;&#x51E0;&#x4E2A;&#x6743;&#x9650;&#x9879;&#x5C31;&#x518D;&#x5B9A;&#x4E49;&#x51E0;&#x4E2A;fid&#xFF0C;&#x5E76;&#x5411;&#x8868; <code>t_permission</code> &#x91CC;&#x9762;&#x65B0;&#x589E;&#x5BF9;&#x5E94;&#x7684;&#x8BB0;&#x5F55;&#x3002;</p>
<p>4&#x3001;&#x7F16;&#x5199;&#x4E1A;&#x52A1;&#x6A21;&#x5757;Controller</p>
<p>Controller&#x9700;&#x8981;&#x4ECE;PSIBaseController&#x7EE7;&#x627F;&#x3002;</p>
<p>&#x4E1A;&#x52A1;&#x6A21;&#x5757;&#x7684;&#x5165;&#x53E3;&#x9875;&#x9762;&#x901A;&#x5E38;&#x7684;action&#x5C31;&#x7528;index()&#x3002;</p>
<p>&#x4E0B;&#x56FE;&#x662F;PermissionController&#x7684;index()&#x7684;&#x65B9;&#x6CD5;&#x3002;</p>
<p><img src="assets/100-01.jpg" alt=""></p>
<blockquote>
<p>&#x5173;&#x952E;&#x6280;&#x672F;&#x70B9;&#xFF1A;</p>
<ol>
<li><p>&#x7528;UserService&#x7684;&#x65B9;&#x6CD5;hasPermission&#x6765;&#x5224;&#x65AD;&#x662F;&#x5426;&#x6709;&#x6743;&#x9650;</p>
</li>
<li><p>&#x5982;&#x679C;&#x6CA1;&#x6709;&#x6743;&#x9650;&#x7528;$this-&gt;gotoLoginPage&#x6765;&#x8DF3;&#x8F6C;&#x9875;&#x9762;</p>
</li>
<li><p>&#x7528;$this-&gt;initVar()&#x521D;&#x59CB;&#x5316;&#x9ED8;&#x8BA4;&#x53D8;&#x91CF;&#x503C;</p>
</li>
</ol>
</blockquote>
<p>&#x8FD9;&#x662F;&#x6807;&#x51C6;&#x7684;ThinkPHP 3.2&#x7684;Controller&#x5F00;&#x53D1;&#x5185;&#x5BB9;&#xFF0C;&#x8BF7;&#x53C2;&#x8003;<a href="https://www.kancloud.cn/manual/thinkphp/1712" target="_blank"><code>ThinkPHP 3.2&#x5F00;&#x53D1;&#x6587;&#x6863;</code></a>&#x3002;</p>
<p>5&#x3001;&#x7F16;&#x5199;&#x4E1A;&#x52A1;&#x6A21;&#x5757;View</p>
<p>&#x4E1A;&#x52A1;&#x6A21;&#x5757;&#x7684;&#x5165;&#x53E3;&#x9875;&#x9762;&#x901A;&#x5E38;&#x7684;action&#x5C31;&#x7528;index()&#xFF0C;&#x5BF9;&#x5E94;&#x7684;View&#x5C31;&#x662F;index.html</p>
<p>&#x8FD9;&#x662F;&#x6807;&#x51C6;&#x7684;ThinkPHP 3.2&#x7684;View&#x5F00;&#x53D1;&#x5185;&#x5BB9;&#xFF0C;&#x8BF7;&#x53C2;&#x8003;<a href="https://www.kancloud.cn/manual/thinkphp/1785" target="_blank"><code>ThinkPHP 3.2&#x5F00;&#x53D1;&#x6587;&#x6863;</code></a>&#x3002;</p>
<p>6&#x3001;&#x4FEE;&#x6539;MainMenuController&#x7684;&#x4EE3;&#x7801;</p>
<p>MainMenuController &#x4F4D;&#x4E8E; <a href="https://gitee.com/crm8000/PSI/blob/master/web/Application/Home/Controller/MainMenuController.class.php" target="_blank"><code>/web/Application/Home/Controller/MainMenuController.class.php</code></a></p>
<p>&#x5728;MainMenuController&#x7684;&#x65B9;&#x6CD5; <code>navigateTo</code> &#x4E2D;&#x589E;&#x52A0;&#x76F8;&#x5E94;&#x7684;&#x8DF3;&#x8F6C;&#x4EE3;&#x7801;&#x3002;</p>

                                
                                </section>
                            
                        </div>
                    </div>
                
            </div>

            
                
                <a href="tech.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page: 二次开发技术手册">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"如何新增一个模块","level":"1.4.1","depth":2,"previous":{"title":"二次开发技术手册","level":"1.4","depth":1,"path":"tech.md","ref":"tech.md","articles":[{"title":"如何新增一个模块","level":"1.4.1","depth":2,"path":"100.md","ref":"100.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["splitter","-search"],"styles":{"website":"styles/website.css"},"pluginsConfig":{"fontsettings":{"theme":"white","family":"serif","size":2},"splitter":{},"highlight":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":false,"twitter":false,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":[]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"李静波","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"PSI使用手册","language":"zh-hans","links":{"sidebar":{"PSI官网":"https://gitee.com/crm8000/PSI"},"gitbook":false,"sharing":{"google":false,"facebook":false,"twitter":false,"all":false}},"gitbook":"*"},"file":{"path":"100.md","mtime":"2018-12-18T05:56:06.801Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-12-18T05:56:20.004Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

